<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/Strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
  <title>Simple FreeGroup Draw2D 0.9.26 Demo</title>
        <link type="text/css" rel="stylesheet" href="../demo.css" />

    <!-- common, all times required, imports -->        <SCRIPT src='../../wz_jsgraphics.js'></SCRIPT>      <SCRIPT src='../../mootools.js'></SCRIPT>      <SCRIPT src='../../moocanvas.js'></SCRIPT>      <SCRIPT src='../../draw2d.js'></SCRIPT>


	<SCRIPT src="./SelectionHighlighter.js"></SCRIPT>
	<SCRIPT src="./Start.js"></SCRIPT>
	<SCRIPT src="./End.js"></SCRIPT>

</head>
<body style="margin:0px;padding:0px;">
<!-- the main drawing area -->
<div id="paintarea" style="width:3000px;height:3000px" >

    <!-- The information help text -->
    <div class="stickyNote">
    <center><b>Draw2D 0.9.26 - A simple diagram drawing demo<br>
    by Andreas Herz (a.herz @ freegroup.de)
    <br>
    </b>
    <br>
    <div style="color:red;font-size:9pt">Focus of this example: Demonstration of the SelectionListener method.</div>
    </center>
    <br>
    <center>See more on <a href="http://www.draw2d.org">FreeGroup Draw2D 0.9.26</a></center>
    </div>


</div>
<script>
  // This demo use the common jacob2D API for object creation.
  // For XML usage see the FreeGroup Draw2D 0.9.26 Workflow demo.
  //
  //


  // Create the interactive paint area
  //
  var workflow  = new draw2d.Workflow("paintarea");

  // Add a simple PropertyDialog to the Canvas
  // This will display the properties of the current select object
  //
  var listener = new draw2d.SelectionHighlighter(workflow);
  workflow.addSelectionListener(listener);

  // Add the start,end,connector to the canvas
  //
  var startObj1 = new draw2d.Start();
  var startObj2 = new draw2d.Start();
  var startObj3 = new draw2d.Start();
  var startObj4 = new draw2d.Start();

  var endObj1   = new draw2d.End();
  var endObj2   = new draw2d.End();
  var endObj3   = new draw2d.End();
  var endObj4   = new draw2d.End();

  workflow.addFigure(startObj1, 400,100);
  workflow.addFigure(startObj2, 450,250);
  workflow.addFigure(startObj3, 250,330);
  workflow.addFigure(startObj4, 150,450);

  workflow.addFigure(endObj1,220,550);
  workflow.addFigure(endObj2,100,290);
  workflow.addFigure(endObj3,550,320);
  workflow.addFigure(endObj4,680,100);

  var c = new draw2d.Connection();
  c.setSource(startObj1.getPort("output1"));
  c.setTarget(endObj1.getPort("input3"));
  workflow.addFigure(c);

  var c = new draw2d.Connection();
  c.setSource(startObj2.getPort("output1"));
  c.setTarget(endObj2.getPort("input4"));
  workflow.addFigure(c);

  var c = new draw2d.Connection();
  c.setSource(startObj2.getPort("output2"));
  c.setTarget(endObj2.getPort("input2"));
  workflow.addFigure(c);


  var c = new draw2d.Connection();
  c.setSource(startObj4.getPort("output2"));
  c.setTarget(endObj2.getPort("input1"));
  workflow.addFigure(c);


  var c = new draw2d.Connection();
  c.setSource(startObj3.getPort("output2"));
  c.setTarget(endObj3.getPort("input1"));
  workflow.addFigure(c);


  var c = new draw2d.Connection();
  c.setSource(startObj3.getPort("output2"));
  c.setTarget(endObj4.getPort("input1"));
  workflow.addFigure(c);



  var c = new draw2d.Connection();
  c.setSource(startObj1.getPort("output2"));
  c.setTarget(endObj1.getPort("input1"));
  workflow.addFigure(c);

  var debugLabel = new draw2d.Label("only for debug");
  workflow.addFigure(debugLabel,500,20);

  window.onscroll=function(){workflow.onScroll();};

</script>
</body>
</html>
